package com.example.puback.consumer;

import com.example.puback.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @version 1.0.0
 * @className: WarningConsumer
 * @description:
 * @author: LiJunYi
 * @create: 2022/8/4 15:41
 */
@Component
@Slf4j
public class WarningConsumer
{
    /**
     * 收到警告信息
     *
     * @param message 消息
     */
    @RabbitListener(queues = ConfirmConfig.WARNING_QUEUE_NAME)
    public void receiveWarningMsg(Message message){
        String msg = new String(message.getBody());
        log.error("报警发现不可路由消息:{}",msg);
    }
}
